The present invention relates to video processing, and more particularly, to a method and apparatus for resolution adaptive video encoding with search range constraint.
The conventional video coding standards generally adopt a block based coding technique to exploit spatial and temporal redundancy. For example, the basic approach is to divide the whole source frame into a plurality of blocks, perform intra prediction/inter prediction on each block, transform residues of each block, and perform quantization and entropy encoding. Besides, a reconstructed frame is generated in a coding loop to provide reference pixel data used for encoding following blocks. For certain video coding standards, in-loop filter(s) may be used for enhancing the image quality of the reconstructed frame.
Successive video frames may contain the same objects (still objects or moving objects). Motion estimation can examine the movement of objects in a video sequence composed of successive video frames to try to obtain vectors representing the estimated motion. Next, motion compensation can use the knowledge of object motion obtained by motion estimation to achieve frame data compression. In inter-frame coding, motion estimation and motion compensation have become powerful techniques to eliminate the temporal redundancy due to high correlation between consecutive video frames.
With regard to a typical coding algorithm, a resolution of a current frame is the same as a resolution of a reference frame (e.g., a reconstructed frame). That is, the current frame and the reference frame have the same width and the same height. Hence, a motion vector of a current block in the current frame can be directly used to locate a reference block in the reference block for motion compensation. However, with regard to a newly-developed coding algorithm, it may allow the frame resolution to be changed on-the-fly. For example, VP9 is an open and royalty-free video coding standard promoted by Google®. In accordance with the VP9 coding specification, the resolution can be changed in continuous inter frame encoding. This feature is called resolution reference frame (RRF). Hence, when a current frame is encoded as an inter frame, the resolution of the current frame can be different from the resolution of a reference frame used for inter prediction. Due to discrepancy between resolutions of the current frame and the reference frame, a motion vector of a current block in the current frame cannot be directly used to locate a reference block in the reference frame. Therefore, the block size of the current block in the current frame is scaled to map to a block size in the reference frame, a motion vector found within a search area in the current frame is scaled to map to a motion vector in the reference frame, and a search area size in the current frame is scaled to map to an effective search area size in the reference frame. If the resolution of the current frame is smaller than the resolution of the reference frame, the effective search area in the reference frame will be larger than the search area in the current frame, which requires a larger search buffer to store a group of pixels within the effective search area in the reference frame for motion estimation and motion compensation.
Thus, there is a need for an innovative video encoder design which is capable of supporting resolution adaptive video encoding (e.g., VP9's RRF) with a reduced search buffer size requirement.